<html>
<head><meta charset="utf-8"><title>manually installing targets · t-compiler/help · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/index.html">t-compiler/help</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/manually.20installing.20targets.html">manually installing targets</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="224506576"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/manually%20installing%20targets/near/224506576" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Veverak <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/manually.20installing.20targets.html#224506576">(Jan 29 2021 at 17:32)</a>:</h4>
<p>I'm trying to use the rustc package in Debian to compile for the target aarch64-linux-android. The standard library for this target does unsurprisingly seem not to be packaged by Debian, so I've had to download it separately. Now, how do I make rustc use this package that I have downloaded? The package comes with <a href="http://install.sh">install.sh</a>, which installs to an unknown location, that rustc doesn't seem to recognize.</p>
<div class="codehilite"><pre><span></span><code>error[E0463]: can&#39;t find crate for `std`
  |
  = note: the `aarch64-linux-android` target may not be installed
</code></pre></div>



<a name="224506864"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/manually%20installing%20targets/near/224506864" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> bjorn3 <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/manually.20installing.20targets.html#224506864">(Jan 29 2021 at 17:34)</a>:</h4>
<p>Can you run with <code>RUSTC_LOG=info</code>? It may be possible that rustc considers it a different version and as such forbids loading it.</p>



<a name="224507217"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/manually%20installing%20targets/near/224507217" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> bjorn3 <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/manually.20installing.20targets.html#224507217">(Jan 29 2021 at 17:37)</a>:</h4>
<p>Or rather I am pretty sure that the version different is. The official rustc distribution includes the git commit in the version string. I assume that the debian compiled version doesn't include it.</p>



<a name="224507676"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/manually%20installing%20targets/near/224507676" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Veverak <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/manually.20installing.20targets.html#224507676">(Jan 29 2021 at 17:40)</a>:</h4>
<div class="codehilite"><pre><span></span><code>$ rustc --version
rustc 1.43.0
</code></pre></div>
<p>I've downloaded <code>rust-std-1.43.0-aarch64-linux-android.tar.xz</code>.</p>
<div class="codehilite"><pre><span></span><code>$ RUSTC_LOG=info rustc --target aarch64-linux-android src/main.rs
[INFO  rustc_metadata::creader] resolving crate `std`
[INFO  rustc_metadata::creader] falling back to a load
[INFO  rustc_metadata::locator] lib candidate: /usr/lib/rustlib/x86_64-unknown-linux-gnu/lib/libstd-b1b61f01951b016b.rlib
[INFO  rustc_metadata::locator] lib candidate: /usr/lib/rustlib/x86_64-unknown-linux-gnu/lib/libstd-b1b61f01951b016b.so
[INFO  rustc_metadata::locator] rlib reading metadata from: /usr/lib/rustlib/x86_64-unknown-linux-gnu/lib/libstd-b1b61f01951b016b.rlib
[INFO  rustc_metadata::locator] reading &quot;libstd-b1b61f01951b016b.rlib&quot; =&gt; 78.42µs
[INFO  rustc_metadata::locator] Rejecting via proc macro: expected true got false
[INFO  rustc_metadata::locator] metadata mismatch
[INFO  rustc_metadata::locator] dylib reading metadata from: /usr/lib/x86_64-linux-gnu/libstd-b1b61f01951b016b.so
[INFO  rustc_metadata::locator] reading &quot;libstd-b1b61f01951b016b.so&quot; =&gt; 16.504163ms
[INFO  rustc_metadata::locator] Rejecting via proc macro: expected true got false
[INFO  rustc_metadata::locator] metadata mismatch
</code></pre></div>



<a name="224507830"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/manually%20installing%20targets/near/224507830" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> bjorn3 <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/manually.20installing.20targets.html#224507830">(Jan 29 2021 at 17:41)</a>:</h4>
<p>Is that everything?</p>



<a name="224507899"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/manually%20installing%20targets/near/224507899" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Veverak <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/manually.20installing.20targets.html#224507899">(Jan 29 2021 at 17:42)</a>:</h4>
<p>yes. Is there anything more I can show?</p>



<a name="224508371"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/manually%20installing%20targets/near/224508371" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> bjorn3 <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/manually.20installing.20targets.html#224508371">(Jan 29 2021 at 17:45)</a>:</h4>
<p>This is the kind of input I get when trying to use a target that isn't installed at all.</p>



<a name="224508532"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/manually%20installing%20targets/near/224508532" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> bjorn3 <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/manually.20installing.20targets.html#224508532">(Jan 29 2021 at 17:46)</a>:</h4>
<p>What is the exact link you downloaded it from?</p>



<a name="224508650"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/manually%20installing%20targets/near/224508650" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Veverak <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/manually.20installing.20targets.html#224508650">(Jan 29 2021 at 17:47)</a>:</h4>
<p>I downloaded <code>https://static.rust-lang.org/dist/2020-04-23/rust-std-1.43.0-aarch64-linux-android.tar.xz</code>.</p>
<p>I guess rustc doesn't find it any better than a target that's not installed at all. Is there a way to check where the target installed and where rustc is looking, or maybe an option to point rustc directly to the folder containing the rlibs?</p>
<p>Even in case it's impossible to use official libstd with Debian rustc, it would be helpful to confirm that, so I know what to say in response to the people at F-Droid who prefer to use Debian things.</p>



<a name="224509062"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/manually%20installing%20targets/near/224509062" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> bjorn3 <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/manually.20installing.20targets.html#224509062">(Jan 29 2021 at 17:50)</a>:</h4>
<p>The default prefix is <code>/usr/local</code> instead of <code>/usr</code> it seems. Try passing <code>--prefix /usr</code> when installing it. You will probably also want to uninstall it from <code>/usr/local</code>. I think there is an uninstall script in <code>/usr/local/lib/rustlib</code>.</p>



<a name="224509755"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/manually%20installing%20targets/near/224509755" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Veverak <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/manually.20installing.20targets.html#224509755">(Jan 29 2021 at 17:54)</a>:</h4>
<p>That helps. Now it's obviously found, but incompatible.</p>
<div class="codehilite"><pre><span></span><code>$ sudo ./install.sh --prefix=/usr
install: creating uninstall script at /usr/lib/rustlib/uninstall.sh
install: installing component &#39;rust-std-aarch64-linux-android&#39;

    std is standing at the ready.
</code></pre></div>
<div class="codehilite"><pre><span></span><code>$ RUSTC_LOG=info rustc --target aarch64-linux-android src/main.rs
[INFO  rustc_metadata::creader] resolving crate `std`
[INFO  rustc_metadata::creader] falling back to a load
[INFO  rustc_metadata::locator] lib candidate: /usr/lib/rustlib/aarch64-linux-android/lib/libstd-08abb398b8e84977.rlib
[INFO  rustc_metadata::locator] lib candidate: /usr/lib/rustlib/aarch64-linux-android/lib/libstd-08abb398b8e84977.so
[INFO  rustc_metadata::locator] rlib reading metadata from: /usr/lib/rustlib/aarch64-linux-android/lib/libstd-08abb398b8e84977.rlib
[INFO  rustc_metadata::locator] reading &quot;libstd-08abb398b8e84977.rlib&quot; =&gt; 295.432µs
[INFO  rustc_metadata::locator] Rejecting via version: expected rustc 1.43.0 got rustc 1.43.0 (4fb7144ed 2020-04-20)
[INFO  rustc_metadata::locator] metadata mismatch
[INFO  rustc_metadata::locator] dylib reading metadata from: /usr/lib/rustlib/aarch64-linux-android/lib/libstd-08abb398b8e84977.so
[INFO  rustc_metadata::locator] reading &quot;libstd-08abb398b8e84977.so&quot; =&gt; 20.23335ms
[INFO  rustc_metadata::locator] Rejecting via version: expected rustc 1.43.0 got rustc 1.43.0 (4fb7144ed 2020-04-20)
[INFO  rustc_metadata::locator] metadata mismatch
[INFO  rustc_metadata::locator] lib candidate: /usr/lib/rustlib/x86_64-unknown-linux-gnu/lib/libstd-b1b61f01951b016b.rlib
[INFO  rustc_metadata::locator] lib candidate: /usr/lib/rustlib/x86_64-unknown-linux-gnu/lib/libstd-b1b61f01951b016b.so
[INFO  rustc_metadata::locator] rlib reading metadata from: /usr/lib/rustlib/x86_64-unknown-linux-gnu/lib/libstd-b1b61f01951b016b.rlib
[INFO  rustc_metadata::locator] reading &quot;libstd-b1b61f01951b016b.rlib&quot; =&gt; 182.613µs
[INFO  rustc_metadata::locator] Rejecting via proc macro: expected true got false
[INFO  rustc_metadata::locator] metadata mismatch
[INFO  rustc_metadata::locator] dylib reading metadata from: /usr/lib/x86_64-linux-gnu/libstd-b1b61f01951b016b.so
[INFO  rustc_metadata::locator] reading &quot;libstd-b1b61f01951b016b.so&quot; =&gt; 25.602988ms
[INFO  rustc_metadata::locator] Rejecting via proc macro: expected true got false
[INFO  rustc_metadata::locator] metadata mismatch
error[E0514]: found crate `std` compiled by an incompatible version of rustc
  |
  = help: please recompile that crate using this compiler (rustc 1.43.0)
  = note: the following crate versions were found:
          crate `std` compiled by rustc 1.43.0 (4fb7144ed 2020-04-20): /usr/lib/rustlib/aarch64-linux-android/lib/libstd-08abb398b8e84977.rlib
          crate `std` compiled by rustc 1.43.0 (4fb7144ed 2020-04-20): /usr/lib/rustlib/aarch64-linux-android/lib/libstd-08abb398b8e84977.so

error: aborting due to previous error
</code></pre></div>



<a name="224509946"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/manually%20installing%20targets/near/224509946" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> bjorn3 <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/manually.20installing.20targets.html#224509946">(Jan 29 2021 at 17:56)</a>:</h4>
<p>Yeah, that is a version incompatibility. There is no way to disable this check without recompiling rustc. It may be easier to just use rustup instead of the distro version.</p>



<a name="224510663"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/manually%20installing%20targets/near/224510663" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Veverak <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/manually.20installing.20targets.html#224510663">(Jan 29 2021 at 18:00)</a>:</h4>
<p>The problem is that the people at F-Droid are very conservative about how they install software. I have one app <a href="https://gitlab.com/fdroid/rfp/-/issues/1611">submission</a> in progress, and it's not getting anywhere, due to confusion about how to compile Rust code.</p>



<a name="224514787"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/manually%20installing%20targets/near/224514787" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> cuviper <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/manually.20installing.20targets.html#224514787">(Jan 29 2021 at 18:31)</a>:</h4>
<p>if they're suspicious of the rustup toolchain, I don't see why they would accept using the rustup std target either</p>



<a name="224515046"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/manually%20installing%20targets/near/224515046" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> cuviper <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/manually.20installing.20targets.html#224515046">(Jan 29 2021 at 18:33)</a>:</h4>
<p>if it's just a problem of rustup itself, but they would be fine with the upstream-compiled toolchain, you can download and install those files just as you did with the target files</p>



<a name="224515510"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/manually%20installing%20targets/near/224515510" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Veverak <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/manually.20installing.20targets.html#224515510">(Jan 29 2021 at 18:38)</a>:</h4>
<p>I don't know exactly what's their suspicion. A <a href="https://f-droid.org/en/2020/10/14/adding-react-native-app-to-f-droid.html">blog post about building a React Native app</a> tells that Debian's version of Node is too old, and then downloads a new version and verifies the hash of the downloaded file to make it less suspicious, but then it goes on to install Yarn from the internet without pinning it to a particular hash, and then uses Yarn to install all dependencies without passing the option to use the frozen lockfile.</p>



<a name="224519264"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/manually%20installing%20targets/near/224519264" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Veverak <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/manually.20installing.20targets.html#224519264">(Jan 29 2021 at 19:09)</a>:</h4>
<p>These are now my instructions for installing everything Rust and the Android target without Rustup and verifying all hashes:</p>
<div class="codehilite" data-code-language="Bash"><pre><span></span><code>wget <span class="se">\</span>
    https://static.rust-lang.org/dist/2020-12-31/rust-std-1.49.0-aarch64-linux-android.tar.xz <span class="se">\</span>
    https://static.rust-lang.org/dist/rust-1.49.0-x86_64-unknown-linux-gnu.tar.gz
<span class="nb">echo</span> -e <span class="s2">"8b14446df82f3707d69cf58fed92f18e0bff91621c62baf89288ef70e3e92981 rust-1.49.0-x86_64-unknown-linux-gnu.tar.gz\n188ea78946f8c4f8c0e9e551ced80f5dd03a14b38397dc25dc1bbea2250d9f6c rust-std-1.49.0-aarch64-linux-android.tar.xz"</span> <span class="se">\</span>
    <span class="p">|</span> sha256sum -c
tar xf rust-std-1.49.0-aarch64-linux-android.tar.xz
<span class="nb">cd</span> rust-1.49.0-x86_64-unknown-linux-gnu
sudo ./install.sh
<span class="nb">cd</span> ..
tar xf rust-1.49.0-x86_64-unknown-linux-gnu.tar.gz
<span class="nb">cd</span> rust-std-1.49.0-aarch64-linux-android
sudo ./install.sh
</code></pre></div>



<a name="224598871"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/manually%20installing%20targets/near/224598871" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/manually.20installing.20targets.html#224598871">(Jan 30 2021 at 18:47)</a>:</h4>
<p>Another option would be to ask Debian to provide the cross-compilation targets.</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>